<template>
    <div class="login">
        <label for="user">账号：</label><input type="text" v-model="user" id="user">
        <label for="password">密码：</label><input type="text" v-model="password" id="password">
        <button @click="login">登录</button>
    </div>
</template>

<script>
    import {mapActions,mapState} from 'vuex'
    export default {
        name: "login",
        data(){
            return{
                user:'',
                password:''
            }
        },
        methods:{
            ...mapActions(['uesrLogin']),
            login(){
                let user ={
                    user:this.user,
                    password:this.password,
                }
                //this.uesrLogin(user).then(res=>{
                    //console.log(res)
                    //if(res === 200){
                        this.$router.push('/index')
                    //}
                //})
            }
        }
    }
</script>

<style scoped>

</style>